package com.bwie.task;

import com.bwie.mapper.TbProdMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @Author: zhaijiaqi
 * @Date: 2025/6/25 16:54
 * @Description:
 **/
@Component
public class ProdTask {
    @Autowired
    TbProdMapper tbProdMapper;


    @Scheduled(cron = "0 0/1 * * * ?")
    public void uploadTask(){
        System.out.println("开始执行定时任务修改商品状态");
        tbProdMapper.updateProdStatusById();
    }


    @Scheduled(cron = "0 0/1 * * * ?")
    public void offlineProdTask(){
        System.out.println("开始定时下架");
        tbProdMapper.taskOfflineProd();
        System.out.println("结束定时下架");
    }
}
